/*
**  File: AquaMacros.h
*/
#ifndef MACROSh
#define MACROSh

#ifdef CVALL
#define FORTRAN_IO
#endif

#define aqua_version     "3.2"
#define aqua_versnum      3.2F  /* float equivalent of version */
#define aqua_versnum_comp 1.0F  /* minimum version number for compatibility */

/* option definitions (possibly) used in different programs;
   ensure unique value - 800 and 900 series reserved, see General.h, MenuTypes.h */
   
#define opt_prtaq      701   /* print Aqua file header */
#define opt_prtres     702   /* print residue list */
#define opt_prtlib     703   /* print active Atom&Pseudo library definitions */
#define opt_prtrst     704   /* print restraint list */
#define opt_prtmap     705   /* print map arrays (range selection) */
#define opt_rest_sel   706   /* restraint selection option (range selection) */
#define opt_crdinp     711   /* type of coordinate input file */
#define opt_crdout     712   /* type of coordinate output file */
#define opt_rstinp     713   /* type of restraint input file */
#define opt_atmlib     715   /* name of AtomLIB */
#define opt_sterlib    716   /* name of StereoLIB */
#define opt_shift      721   /* shift value restraint residue numbers */
#define opt_guess      722   /* guess atom names while mapping */
#define opt_oldmap     723   /* use old mapping procedure for restraints */
#define opt_multi      724   /* check for multiply defined restraints */
#define opt_find2      731   /* use FindAtom2 instead of FindAtom3 */
#define opt_element_guess_pdb 732 /* guess the element in a PDB file */

#define size_TYPNAM    21
#define size_RESID     17    /* see MakeUniqResid and ReadUniqResid */
#define size_ID        5
#define format_FILNAM  "%80s"

#define max_PSFORM  6

#define num_CONTACTRANGE 5   /* number of items in ContactRange enum type 
                                excluding undef_rng */
#define max_MEDIUMRANGE 4

#define large_BOUND  99999.0F
#define small_BOUND -99999.0F
#define wild_RESNUM  32767
#define CHAIN    '_'         /* identifier printed as prefix to chain id */

#define PRINTC(x, size)     PrintChars(x, LenChars(x, (size_t)(size)) )
#define PRINTID(x)          PrintChars(x, (size_t)(size_ID) )
#define PRINTIDv(x)         PrintChars(x, LenChars(x, (size_t)(size_ID)) )
#define FPRINTC(fp, x, size) FPrintChars(fp, x, LenChars(x, (size_t)(size)) )
#define FPRINTID(fp, x)     FPrintChars(fp, x, (size_t)(size_ID) )
#define FPRINTIDv(fp, x)    FPrintChars(fp, x, LenChars(x, (size_t)(size_ID)) )

#define EQID(a, b)          (memcmp((a), (b), (size_t)(size_ID)) == 0)
#define NOTEQID(a, b)       (memcmp((a), (b), (size_t)(size_ID)) != 0)

#define EMPTYSET(set)       ((set).atom_count == 0)

#define SQRDIST(a, b)       ((a.x-b.x)*(a.x-b.x) + (a.y-b.y)*(a.y-b.y) + (a.z-b.z)*(a.z-b.z))

#endif
